<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@page import="com.yaodian100.core.common.utils.ServerValue"%>
<%@page import="com.yaodian100.mall.member.util.UserData"%>
<%@page import="com.yaodian100.ec.member.entity.Member"%>
<%@page import="com.yaodian100.ec.member.service.MemberService"%>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="org.apache.commons.lang.StringUtils"%>
<c-rt:set var="hostName" value='<%=request.getServerName()%>'/>
<c-rt:set var="frontContextPath" value='<%=ServerValue.getFrontContextPath()%>'/>
<%	Member member = (Member)request.getAttribute("member");
	if(null == member){
		UserData userData = new UserData(request,response);
		MemberService memberService = (MemberService)WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext()).getBean("memberService");
		member = memberService.getMemberByLoginId(userData.getLoginId(),request.getServerName());
	}%>
<div class="sidebar">
	<h1><b>我的耀点</b></h1>
	<p>我的订单</p>
	<ul>
		<li>．<a href="${frontContextPath}/member/myOrder/showOrders.do?t=T&p=1" id="m_recentOrders">近三个月订单</a></li>
		<li>．<a href="${frontContextPath}/member/myOrder/showOrders.do?t=H&p=1" id="m_historyOrders">全部订单</a></li>
	</ul>
	
	<p>收藏盒</p>
	<ul>
		<%if("nonmember".equalsIgnoreCase(member.getApplySource())){ %>
		<li>．<a href="javascript:;" onclick='checkLoginMember("${frontContextPath}/member/myCollection/toproductc.do");' id="m_myCollection">收藏商品</a></li>
		<li>．<a href="javascript:;" onclick='checkLoginMember("${frontContextPath}/member/myCollection/tocategoriesc.do");' id="m_mycategorie">收藏类别</a></li>
		<%}else{ %>
		<li>．<a href="${frontContextPath}/member/myCollection/toproductc.do" id="m_myCollection">收藏商品</a></li>
		<li>．<a href="${frontContextPath}/member/myCollection/tocategoriesc.do" id="m_mycategorie">收藏类别</a></li>
		<%} %>
	</ul>
	<p>评价商品</p>
	<ul>
		<li>．<a href="${frontContextPath}/member/mycomment/mycomment.do?p=1" id="m_mycomment">可评价的商品</a></li>
		<li>．<a href="${frontContextPath}/member/mycomment/commentHistory.do?p=1" id="m_commenthistory">已发表的评价</a></li>
	</ul>
	<p>商品问答</p>
	
	<ul>
		<%if("nonmember".equalsIgnoreCase(member.getApplySource())){ %>	
		<li>．<a href="javascript:;" onclick='checkLoginMember("${frontContextPath}/member/product/qaa.do?answered=true&orderByAnswerDate=desc");' id="m_product_answered">已回答 </a></li>
		<li>．<a href="javascript:;" onclick='checkLoginMember("${frontContextPath}/member/product/qaa.do?answered=false&orderByQuestionDate=desc");' id="m_product_asked">发问中</a></li>
		<%}else{ %>	
		<li>．<a href="${frontContextPath}/member/product/qaa.do?answered=true&orderByAnswerDate=desc" id="m_product_answered">已回答 </a></li>
		<li>．<a href="${frontContextPath}/member/product/qaa.do?answered=false&orderByQuestionDate=desc" id="m_product_asked">发问中</a></li>
		<%} %>
	</ul>
	<p>帐户管理</p>
	<ul>
		<%if("nonmember".equalsIgnoreCase(member.getApplySource())){ %>	
		<li>．<a href="javascript:;" onclick='checkLoginMember("${frontContextPath}/member/myBonus/tomybonus.do");' id="m_mybonus">我的积分</a></li>
		<li>．<a href="javascript:;" onclick='checkLoginMember("${frontContextPath}/member/myCoupon/tomycoupon.do");' id="m_mycoupon">我的礼券</a></li>
		<%}else{ %>	
		<li>．<a href="${frontContextPath}/member/myBonus/tomybonus.do" id="m_mybonus">我的积分</a></li>
		<li>．<a href="${frontContextPath}/member/myCoupon/tomycoupon.do" id="m_mycoupon">我的礼券</a></li>
		<%} %>
		<li>．<a href="${frontContextPath}/member/myBank/myBank.do" id="m_myBank">账户余额</a></li>
		<li>．<a href="${frontContextPath}/member/myGiftcard/tomygiftcard.do" id="m_mygiftcard">我的礼品卡</a></li>
	</ul>
	<c:if test="${fn:endsWith(hostName, 'yaodian100.com')}">
	<p>个人信息管理</p>	
	<ul>
		<%if("nonmember".equalsIgnoreCase(member.getApplySource())){ %>	
			<li>．<a href="javascript:;" onclick='checkLoginMember("${frontContextPath}/member/modifydata.do");' id="m_modifyData">修改个人信息</a></li>
		<%}else{ %>	
			<li>．<a href="${frontContextPath}/member/modifydata.do" id="m_modifyData">修改个人信息</a></li>
		<%} %>
		<%if(!ServerValue.getTrustMembers().contains(member.getApplySource())){%>
			<li>．<a href="${frontContextPath}/member/tomodifypwd.do" id="m_modifwPWD">修改密码</a></li>
		<%} %>
		<li>．<a href="${frontContextPath}/member/tomyaddbook.do" id="m_addressBook">管理收货地址簿</a></li>
		<%if("nonmember".equalsIgnoreCase(member.getApplySource())){ %>	
		<li>．<a href="javascript:;" onclick='checkLoginMember("${frontContextPath}/member/tomodifyedm.do");' id="m_modifyedm">订阅/退订邮件</a></li>
		<%}else{ %>	
		<li>．<a href="${frontContextPath}/member/tomodifyedm.do" id="m_modifyedm">订阅／退订活动信息</a></li>
		<%} %>
	</ul>
	</c:if>
	<c:if test="${!fn:endsWith(hostName, 'yaodian100.com')}">
	<p>个人信息管理</p>	
	<ul>		
		<li>．<a href="${frontContextPath}/member/tomyaddbook.do" id="m_addressBook">管理收货地址簿</a></li>		
	</ul>
	</c:if>
	<p>客服问答纪录</p>
	
	<ul>
		<li>．<a href="${frontContextPath}/member/cs/qaa.do?answered=false" id="m_cs_asked">发问中</a></li>
		<li>．<a href="${frontContextPath}/member/cs/qaa.do?answered=true" id="m_cs_answered">已回答</a></li>
	</ul>
	<img class="sidebar-ft" width="170" height="14" alt="" src="${frontContextPath}/images/none.gif"/>
	<img id="telicon" src="/images/service_tel.gif" alt="耀点客服电话 4001-168-100" />
</div>